#include<p18f4550.h>
#include<xc.h>
# include <stdio.h>
# include <stdlib.h>
#include <delays.h>
#include <plib.h>

#define _XTAL_FREQ 4000000

#pragma config CPUDIV = OSC1_PLL2
#pragma config PLLDIV = 1
#pragma config FOSC = XT_XT
#pragma config WDT = OFF
#pragma config LVP = OFF
#pragma config BOR = OFF
#pragma config MCLRE = ON
#pragma config PWRT = ON
#pragma config PBADEN = OFF
//int fila[3][8]={{0x0,0x2,0x2,0x7E,0x42,0x42,0x42,0x0}/*J*/,{0x0,0x7E,0x42,0x4A,0x4A,0x4A,0x4E,0x00}/*G*/,{0x0,0x7E,0x46,0x4A,0x52,0x62,0x7E,0x00}/*0*/};
int fila1[8]={0x0,0x2,0x2,0x7E,0x42,0x42,0x42,0x0};//letra J
int fila2[8]={0x0,0x7E,0x42,0x4A,0x4A,0x4A,0x4E,0x00};//letra G
int fila3[8]={0x0,0x7E,0x46,0x4A,0x52,0x62,0x7E,0x000};//numero 0

                          int a=0,b=0;// vector de activacion de fila,acticado por un 0 logico
//{255,221,221,193,222,222,255,255};una j con 0
void main (){
    ADCON1=15;TRISB=0x00;TRISD=0x00;
    while(1){ PORTD=1;//activacion de columnas
    for(a=0;a<8;a++){//ciclo barrido columnas
    
   PORTB=fila1[a];
    PORTB=fila2[a];
 PORTB=fila3[a];// se envia valor del arreglo respectivo a cada led
   Delay1KTCYx(1);
    LATD<<=1;   }//cambio de columna por dezplazamiento de dato en el latch del puerto
    }}